PV-on-HVM: Define DEFINE_RWLOCK() macro for older Linux kernels.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 30 Aug 2007 15:17:07 +0000 (16:17 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 30 Aug 2007 15:17:07 +0000 (16:17 +0100)
Signed-off-by: Ben Guthro <bguthro@virtualron.com>
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h

index ad53d95b791d9261103ebbf35160e3b11c8603e4..54a81f6ee9461c28d0cc90bf2333253c59c4dd42 100644 (file)
@@ -116,4 +116,13 @@ extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
 #define DEFINE_SEQLOCK(x) seqlock_t x = SEQLOCK_UNLOCKED
 #endif
 
+/* Bug in RHEL4-U3: rw_lock_t is mistakenly defined in DEFINE_RWLOCK() macro */
+#if defined(__LINUX_SPINLOCK_H) && defined(DEFINE_RWLOCK)
+#define rw_lock_t rwlock_t
+#endif
+
+#if defined(__LINUX_SPINLOCK_H) && !defined(DEFINE_RWLOCK)
+#define DEFINE_RWLOCK(x) rwlock_t x = RW_LOCK_UNLOCKED
+#endif
+
 #endif